Skip to content

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Apr 15, 2025

This PR only affects the AST and doesn't actually change anything semantically.

All occurrences of ~const outside of libcore have been replaced by [const]. Within libcore we have to wait for rustfmt to be bumped in the bootstrap compiler. This will happen "automatically" (when rustfmt is run) during the bootstrap bump, as rustfmt converts ~const into [const]. After this we can remove the ~const support from the parser

Caveat discovered during impl: there is no legacy bare trait object recovery for [const] Trait as that snippet in type position goes down the slice /array parsing code and will error

r? @fee1-dead

cc @nikomatsakis @traviscross @compiler-errors

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Apr 15, 2025
@rustbot
Copy link
Collaborator

rustbot commented Apr 15, 2025

Some changes occurred in src/tools/rustfmt

cc @rust-lang/rustfmt

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@oli-obk oli-obk force-pushed the new-const-traits-syntax branch from f6be056 to 2003458 Compare April 15, 2025 09:04
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the new-const-traits-syntax branch from 2003458 to d6da247 Compare April 15, 2025 09:51
@rustbot

This comment was marked as outdated.

@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the new-const-traits-syntax branch from d6da247 to e16c40b Compare April 15, 2025 12:38
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the new-const-traits-syntax branch from 234ba91 to ef1acde Compare April 17, 2025 13:04
@oli-obk oli-obk force-pushed the new-const-traits-syntax branch from ef1acde to 5fa25d4 Compare April 29, 2025 09:04
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the new-const-traits-syntax branch from 5fa25d4 to 7762468 Compare April 29, 2025 09:55
@bors
Copy link
Collaborator

bors commented May 6, 2025

☔ The latest upstream changes (presumably #140695) made this pull request unmergeable. Please resolve the merge conflicts.

@compiler-errors
Copy link
Member

Have we actually settled on a syntax here? Sorry for punting it back over, but would like to get an update here if it's actually ready to review :> ping me when it's ready, sorry for the delays!

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 22, 2025
@rustbot
Copy link
Collaborator

rustbot commented May 22, 2025

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@traviscross
Copy link
Contributor

Have we actually settled on a syntax here?

No. Discussion is ongoing.

@rustbot
Copy link
Collaborator

rustbot commented Jun 26, 2025

There are changes to the tidy tool.

cc @jieyouxu

@rustbot rustbot added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jun 26, 2025
@rust-log-analyzer

This comment has been minimized.

@oli-obk oli-obk force-pushed the new-const-traits-syntax branch from a9f1140 to 512ff95 Compare June 26, 2025 13:46
@fee1-dead
Copy link
Member

@bors r+ rollup=never

@bors
Copy link
Collaborator

bors commented Jun 27, 2025

📌 Commit 512ff95 has been approved by fee1-dead

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 27, 2025
@compiler-errors
Copy link
Member

This affects a lot of tests but I don't expect it to fail, except if there's an untested doc test or something.

@bors rollup=iffy

compiler-errors added a commit to compiler-errors/rust that referenced this pull request Jun 27, 2025
…=fee1-dead

New const traits syntax

This PR only affects the AST and doesn't actually change anything semantically.

All occurrences of `~const` outside of libcore have been replaced by `[const]`. Within libcore we have to wait for rustfmt to be bumped in the bootstrap compiler. This will happen "automatically" (when rustfmt is run) during the bootstrap bump, as rustfmt converts `~const` into `[const]`. After this we can remove the `~const` support from the parser

Caveat discovered during impl: there is no legacy bare trait object recovery for `[const] Trait` as that snippet in type position goes down the slice /array parsing code and will error

r? `@fee1-dead`

cc `@nikomatsakis` `@traviscross` `@compiler-errors`
bors added a commit that referenced this pull request Jun 27, 2025
…rors

Rollup of 8 pull requests

Successful merges:

 - #139858 (New const traits syntax)
 - #140809 (Reduce special casing for the panic runtime)
 - #142963 (Skip unnecessary components in x64 try builds)
 - #142974 (Update stage0 to 1.89.0-beta.1)
 - #142987 (rustdoc: show attributes on enum variants)
 - #143002 (tests: Require `run-fail` ui tests to have an exit code (`SIGABRT` not ok))
 - #143092 (const checks for lifetime-extended temporaries: avoid 'top-level scope' terminology)
 - #143096 (tag_for_variant: properly pass TypingEnv)

r? `@ghost`
`@rustbot` modify labels: rollup
bors added a commit that referenced this pull request Jun 27, 2025
Rollup of 9 pull requests

Successful merges:

 - #139858 (New const traits syntax)
 - #140809 (Reduce special casing for the panic runtime)
 - #142730 (suggest declaring modules when file found but module not defined)
 - #142806 (Normalize before computing ConstArgHasType goal in new solver)
 - #143046 (const validation: properly ignore zero-sized UnsafeCell)
 - #143092 (const checks for lifetime-extended temporaries: avoid 'top-level scope' terminology)
 - #143096 (tag_for_variant: properly pass TypingEnv)
 - #143104 (hir_analysis: prohibit `dyn PointeeSized`)
 - #143106 (gce: don't ICE on non-local const)

Failed merges:

 - #143036 (Remove support for `dyn*` from the compiler)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 36c2b01 into rust-lang:master Jun 28, 2025
10 checks passed
@rustbot rustbot added this to the 1.90.0 milestone Jun 28, 2025
@bors
Copy link
Collaborator

bors commented Jun 28, 2025

⌛ Testing commit 512ff95 with merge d41e12f...

rust-timer added a commit that referenced this pull request Jun 28, 2025
Rollup merge of #139858 - oli-obk:new-const-traits-syntax, r=fee1-dead

New const traits syntax

This PR only affects the AST and doesn't actually change anything semantically.

All occurrences of `~const` outside of libcore have been replaced by `[const]`. Within libcore we have to wait for rustfmt to be bumped in the bootstrap compiler. This will happen "automatically" (when rustfmt is run) during the bootstrap bump, as rustfmt converts `~const` into `[const]`. After this we can remove the `~const` support from the parser

Caveat discovered during impl: there is no legacy bare trait object recovery for `[const] Trait` as that snippet in type position goes down the slice /array parsing code and will error

r? ``@fee1-dead``

cc ``@nikomatsakis`` ``@traviscross`` ``@compiler-errors``
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Jun 28, 2025
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#139858 (New const traits syntax)
 - rust-lang/rust#140809 (Reduce special casing for the panic runtime)
 - rust-lang/rust#142730 (suggest declaring modules when file found but module not defined)
 - rust-lang/rust#142806 (Normalize before computing ConstArgHasType goal in new solver)
 - rust-lang/rust#143046 (const validation: properly ignore zero-sized UnsafeCell)
 - rust-lang/rust#143092 (const checks for lifetime-extended temporaries: avoid 'top-level scope' terminology)
 - rust-lang/rust#143096 (tag_for_variant: properly pass TypingEnv)
 - rust-lang/rust#143104 (hir_analysis: prohibit `dyn PointeeSized`)
 - rust-lang/rust#143106 (gce: don't ICE on non-local const)

Failed merges:

 - rust-lang/rust#143036 (Remove support for `dyn*` from the compiler)

r? `@ghost`
`@rustbot` modify labels: rollup
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Jul 10, 2025
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#139858 (New const traits syntax)
 - rust-lang/rust#140809 (Reduce special casing for the panic runtime)
 - rust-lang/rust#142730 (suggest declaring modules when file found but module not defined)
 - rust-lang/rust#142806 (Normalize before computing ConstArgHasType goal in new solver)
 - rust-lang/rust#143046 (const validation: properly ignore zero-sized UnsafeCell)
 - rust-lang/rust#143092 (const checks for lifetime-extended temporaries: avoid 'top-level scope' terminology)
 - rust-lang/rust#143096 (tag_for_variant: properly pass TypingEnv)
 - rust-lang/rust#143104 (hir_analysis: prohibit `dyn PointeeSized`)
 - rust-lang/rust#143106 (gce: don't ICE on non-local const)

Failed merges:

 - rust-lang/rust#143036 (Remove support for `dyn*` from the compiler)

r? `@ghost`
`@rustbot` modify labels: rollup
flip1995 pushed a commit to flip1995/rust that referenced this pull request Jul 10, 2025
…=fee1-dead

New const traits syntax

This PR only affects the AST and doesn't actually change anything semantically.

All occurrences of `~const` outside of libcore have been replaced by `[const]`. Within libcore we have to wait for rustfmt to be bumped in the bootstrap compiler. This will happen "automatically" (when rustfmt is run) during the bootstrap bump, as rustfmt converts `~const` into `[const]`. After this we can remove the `~const` support from the parser

Caveat discovered during impl: there is no legacy bare trait object recovery for `[const] Trait` as that snippet in type position goes down the slice /array parsing code and will error

r? ``@fee1-dead``

cc ``@nikomatsakis`` ``@traviscross`` ``@compiler-errors``
jerusdp added a commit to jerus-org/captval that referenced this pull request Aug 24, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [syn](https://redirect.github.com/dtolnay/syn) |
workspace.dependencies | patch | `2.0.104` -> `2.0.106` |

---

### Release Notes

<details>
<summary>dtolnay/syn (syn)</summary>

###
[`v2.0.106`](https://redirect.github.com/dtolnay/syn/releases/tag/2.0.106)

[Compare
Source](https://redirect.github.com/dtolnay/syn/compare/2.0.105...2.0.106)

- Replace `~const` syntax with `[const]` conditionally const syntax in
trait bounds
([#&#8203;1896](https://redirect.github.com/dtolnay/syn/issues/1896),
[rust-lang/rust#139858](https://redirect.github.com/rust-lang/rust/pull/139858))
- Support conditionally const impl Trait types
([#&#8203;1897](https://redirect.github.com/dtolnay/syn/issues/1897))
- Reject polarity modifier and lifetime binder used in the same trait
bound
([#&#8203;1899](https://redirect.github.com/dtolnay/syn/issues/1899),
[rust-lang/rust#127054](https://redirect.github.com/rust-lang/rust/pull/127054))
- Parse const trait bounds with bound lifetimes
([#&#8203;1902](https://redirect.github.com/dtolnay/syn/issues/1902))
- Parse bound lifetimes with lifetime bounds
([#&#8203;1903](https://redirect.github.com/dtolnay/syn/issues/1903))
- Allow type parameters and const parameters in trait bounds and generic
closures
([#&#8203;1904](https://redirect.github.com/dtolnay/syn/issues/1904),
[#&#8203;1907](https://redirect.github.com/dtolnay/syn/issues/1907),
[#&#8203;1908](https://redirect.github.com/dtolnay/syn/issues/1908),
[#&#8203;1909](https://redirect.github.com/dtolnay/syn/issues/1909))

###
[`v2.0.105`](https://redirect.github.com/dtolnay/syn/releases/tag/2.0.105)

[Compare
Source](https://redirect.github.com/dtolnay/syn/compare/2.0.104...2.0.105)

- Disallow "negative" inherent impls like `impl !T {}`
([#&#8203;1881](https://redirect.github.com/dtolnay/syn/issues/1881),
[rust-lang/rust#144386](https://redirect.github.com/rust-lang/rust/pull/144386))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 05:59 AM, on day
24 of the month ( * 0-5 24 * * ) (UTC), Automerge - At any time (no
schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/jerus-org/captval).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS44MS4yIiwidXBkYXRlZEluVmVyIjoiNDEuODIuNyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
dhruvmanila pushed a commit to astral-sh/ruff that referenced this pull request Aug 25, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [syn](https://redirect.github.com/dtolnay/syn) |
workspace.dependencies | patch | `2.0.104` -> `2.0.106` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>dtolnay/syn (syn)</summary>

###
[`v2.0.106`](https://redirect.github.com/dtolnay/syn/releases/tag/2.0.106)

[Compare
Source](https://redirect.github.com/dtolnay/syn/compare/2.0.105...2.0.106)

- Replace `~const` syntax with `[const]` conditionally const syntax in
trait bounds
([#&#8203;1896](https://redirect.github.com/dtolnay/syn/issues/1896),
[rust-lang/rust#139858](https://redirect.github.com/rust-lang/rust/pull/139858))
- Support conditionally const impl Trait types
([#&#8203;1897](https://redirect.github.com/dtolnay/syn/issues/1897))
- Reject polarity modifier and lifetime binder used in the same trait
bound
([#&#8203;1899](https://redirect.github.com/dtolnay/syn/issues/1899),
[rust-lang/rust#127054](https://redirect.github.com/rust-lang/rust/pull/127054))
- Parse const trait bounds with bound lifetimes
([#&#8203;1902](https://redirect.github.com/dtolnay/syn/issues/1902))
- Parse bound lifetimes with lifetime bounds
([#&#8203;1903](https://redirect.github.com/dtolnay/syn/issues/1903))
- Allow type parameters and const parameters in trait bounds and generic
closures
([#&#8203;1904](https://redirect.github.com/dtolnay/syn/issues/1904),
[#&#8203;1907](https://redirect.github.com/dtolnay/syn/issues/1907),
[#&#8203;1908](https://redirect.github.com/dtolnay/syn/issues/1908),
[#&#8203;1909](https://redirect.github.com/dtolnay/syn/issues/1909))

###
[`v2.0.105`](https://redirect.github.com/dtolnay/syn/releases/tag/2.0.105)

[Compare
Source](https://redirect.github.com/dtolnay/syn/compare/2.0.104...2.0.105)

- Disallow "negative" inherent impls like `impl !T {}`
([#&#8203;1881](https://redirect.github.com/dtolnay/syn/issues/1881),
[rust-lang/rust#144386](https://redirect.github.com/rust-lang/rust/pull/144386))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on Monday" (UTC),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/astral-sh/ruff).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS44Mi43IiwidXBkYXRlZEluVmVyIjoiNDEuODIuNyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiaW50ZXJuYWwiXX0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
konstin pushed a commit to astral-sh/uv that referenced this pull request Aug 25, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [syn](https://redirect.github.com/dtolnay/syn) |
workspace.dependencies | patch | `2.0.104` -> `2.0.106` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>dtolnay/syn (syn)</summary>

###
[`v2.0.106`](https://redirect.github.com/dtolnay/syn/releases/tag/2.0.106)

[Compare
Source](https://redirect.github.com/dtolnay/syn/compare/2.0.105...2.0.106)

- Replace `~const` syntax with `[const]` conditionally const syntax in
trait bounds
([#&#8203;1896](https://redirect.github.com/dtolnay/syn/issues/1896),
[rust-lang/rust#139858](https://redirect.github.com/rust-lang/rust/pull/139858))
- Support conditionally const impl Trait types
([#&#8203;1897](https://redirect.github.com/dtolnay/syn/issues/1897))
- Reject polarity modifier and lifetime binder used in the same trait
bound
([#&#8203;1899](https://redirect.github.com/dtolnay/syn/issues/1899),
[rust-lang/rust#127054](https://redirect.github.com/rust-lang/rust/pull/127054))
- Parse const trait bounds with bound lifetimes
([#&#8203;1902](https://redirect.github.com/dtolnay/syn/issues/1902))
- Parse bound lifetimes with lifetime bounds
([#&#8203;1903](https://redirect.github.com/dtolnay/syn/issues/1903))
- Allow type parameters and const parameters in trait bounds and generic
closures
([#&#8203;1904](https://redirect.github.com/dtolnay/syn/issues/1904),
[#&#8203;1907](https://redirect.github.com/dtolnay/syn/issues/1907),
[#&#8203;1908](https://redirect.github.com/dtolnay/syn/issues/1908),
[#&#8203;1909](https://redirect.github.com/dtolnay/syn/issues/1909))

###
[`v2.0.105`](https://redirect.github.com/dtolnay/syn/releases/tag/2.0.105)

[Compare
Source](https://redirect.github.com/dtolnay/syn/compare/2.0.104...2.0.105)

- Disallow "negative" inherent impls like `impl !T {}`
([#&#8203;1881](https://redirect.github.com/dtolnay/syn/issues/1881),
[rust-lang/rust#144386](https://redirect.github.com/rust-lang/rust/pull/144386))

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "before 4am on Monday" (UTC),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/astral-sh/uv).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS44Mi43IiwidXBkYXRlZEluVmVyIjoiNDEuODIuNyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiaW50ZXJuYWwiXX0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-run-make Area: port run-make Makefiles to rmake.rs A-tidy Area: The tidy tool S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants